man: Add man page for create-usb
authorMatthew Leeds <matthew.leeds@endlessm.com>
Tue, 17 Apr 2018 21:35:52 +0000 (14:35 -0700)
committerAtomic Bot <atomic-devel@projectatomic.io>
Thu, 19 Apr 2018 13:35:15 +0000 (13:35 +0000)
Closes: #1543
Approved by: cgwalters

Makefile-man.am
man/ostree-create-usb.xml [new file with mode: 0644]
man/ostree-find-remotes.xml
man/ostree.xml
src/libostree/ostree-repo-finder-mount.c
src/ostree/ot-builtin-create-usb.c

index 4d99cde1b292cb218a0bc741e1620c8fb80f72f5..342af520a393afa62b8fc584e14d07d378cc3827 100644 (file)
@@ -45,7 +45,7 @@ man1_files += rofiles-fuse.1
 endif
 
 if ENABLE_EXPERIMENTAL_API
-man1_files += ostree-find-remotes.1
+man1_files += ostree-find-remotes.1 ostree-create-usb.1
 endif
 
 man5_files = ostree.repo.5 ostree.repo-config.5
diff --git a/man/ostree-create-usb.xml b/man/ostree-create-usb.xml
new file mode 100644 (file)
index 0000000..d250d91
--- /dev/null
@@ -0,0 +1,127 @@
+<?xml version='1.0'?> <!--*-nxml-*-->
+<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
+    "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
+
+<!--
+Copyright 2018 Matthew Leeds <matthew.leeds@endlessm.com>
+
+SPDX-License-Identifier: LGPL-2.0+
+
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2 of the License, or (at your option) any later version.
+
+This library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library; if not, write to the
+Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA.
+-->
+
+<refentry id="ostree">
+
+    <refentryinfo>
+        <title>ostree create-usb</title>
+        <productname>OSTree</productname>
+
+        <authorgroup>
+            <author>
+                <contrib>Developer</contrib>
+                <firstname>Matthew</firstname>
+                <surname>Leeds</surname>
+                <email>matthew.leeds@endlessm.com</email>
+            </author>
+        </authorgroup>
+    </refentryinfo>
+
+    <refmeta>
+        <refentrytitle>ostree create-usb</refentrytitle>
+        <manvolnum>1</manvolnum>
+    </refmeta>
+
+    <refnamediv>
+        <refname>ostree-create-usb</refname>
+        <refpurpose>Put the given refs on an external drive for P2P distribution.</refpurpose>
+    </refnamediv>
+
+    <refsynopsisdiv>
+            <cmdsynopsis>
+                <command>ostree create-usb</command> <arg choice="opt" rep="repeat">OPTIONS</arg> <arg choice="req">MOUNT-PATH</arg> <arg choice="req">COLLECTION-ID REF</arg> <arg choice="opt" rep="repeat">COLLECTION-ID REF</arg>
+            </cmdsynopsis>
+    </refsynopsisdiv>
+
+    <refsect1>
+        <title>Description</title>
+
+        <para>
+            This command creates a repository in MOUNT-PATH and pulls the given
+            REF(s) into it so they can be found and pulled from (perhaps by another computer that's offline).
+            See
+            <citerefentry><refentrytitle>ostree-find-remotes</refentrytitle><manvolnum>1</manvolnum></citerefentry>
+            for more information on P2P distribution.
+        </para>
+        <para>
+            In order for ostree to pull refs from a mounted filesystem (such as
+            a USB drive) the repo must be in a standard location. Specifically,
+            subdirectories of <filename>.ostree/repos.d</filename> are checked,
+            then <filename>.ostree/repo</filename>, <filename>ostree/repo</filename>,
+            and <filename>var/lib/flatpak/repo</filename> are checked. By default
+            <command>ostree create-usb</command> uses <filename>.ostree/repo</filename>,
+            but if you specify another location using <option>--destination-repo</option>
+            a symbolic link will be created for you in <filename>.ostree/repos.d</filename>.
+        </para>
+        <para>
+            This command will regenerate the <filename>summary</filename> file
+            in the destination repo so that it stays accurate, so you shouldn't
+            try to use summary signatures in the destination repo. This
+            shouldn't be a concern because clients that support pulling from
+            USB mounts use signed per-repo and per-commit metadata instead of
+            summary signatures.
+        </para>
+        <para>
+            This command relies on the summary file in the source repo, so you
+            may want to run <command>ostree summary -u</command> before running
+            this command.
+        </para>
+    </refsect1>
+
+    <refsect1>
+        <title>Options</title>
+
+        <variablelist>
+            <varlistentry>
+                <term><option>--disable-fsync</option></term>
+
+                <listitem><para>
+                  Do not invoke fsync().
+                </para>
+                </listitem>
+            </varlistentry>
+
+            <varlistentry>
+                <term><option>--destination-repo</option>=DEST</term>
+
+                <listitem><para>
+                  Create the repository in DEST under MOUNT-PATH, rather than
+                  the default location.
+                </para></listitem>
+            </varlistentry>
+
+        </variablelist>
+    </refsect1>
+
+    <refsect1>
+        <title>Example</title>
+        <para><command>ostree --repo=/var/lib/flatpak/repo create-usb /run/media/mwleeds/f6d04c7a-60f6-4ba3-bb96-0f40498675be com.exampleos.Apps app/org.kde.Khangman/x86_64/stable com.exampleos.Apps ostree-metadata com.exampleos.Apps appstream/x86_64</command></para>
+<programlisting>
+
+5 metadata, 213 content objects imported; 1 KiB transferred in 1 seconds                                                                                                                      Copied 3/3 refs successfully from ‘/var/lib/flatpak/repo’ to ‘.ostree/repo’ repository in ‘/run/media/mwleeds/f6d04c7a-60f6-4ba3-bb96-0f40498675be’.
+
+</programlisting>
+    </refsect1>
+</refentry>
index f0208b7c0314f3baf3be8198218c51b3147da321..15f5a516473e1b0c5fef0cfd1fe7ebe6664ce6d1 100644 (file)
@@ -78,6 +78,12 @@ Boston, MA 02111-1307, USA.
             default set of finders (sources for remotes) using the
             <option>--finders</option> option documented below.
         </para>
+        <para>
+            The <command>create-usb</command> command is the recommended way to
+            put refs on a USB such that <command>find-remotes</command> will
+            discover them. See
+            <citerefentry><refentrytitle>ostree-create-usb</refentrytitle><manvolnum>1</manvolnum></citerefentry>.
+        </para>
     </refsect1>
 
     <refsect1>
index 06076c4566eda202a0a2ca494be54b8f5f94e080..8a79cd0490390f1ecbb3764852a983692d7519c8 100644 (file)
@@ -283,6 +283,15 @@ Boston, MA 02111-1307, USA.
                 </para></listitem>
             </varlistentry>
 
+            <!-- FIXME: Uncomment this when it's no longer experimental
+            <varlistentry>
+                <term><citerefentry><refentrytitle>ostree-create-usb</refentrytitle><manvolnum>1</manvolnum></citerefentry></term>
+
+                <listitem><para>
+                    &nbsp;Put the given refs on an external drive for P2P distribution.
+                </para></listitem>
+            </varlistentry>-->
+
             <varlistentry>
                 <term><citerefentry><refentrytitle>ostree-diff</refentrytitle><manvolnum>1</manvolnum></citerefentry></term>
 
index 7339fe522fee98c3b857755e1cc2b4b61d223a46..09e850358b211fc596c16272cf104ee9030ec00b 100644 (file)
@@ -434,7 +434,8 @@ G_GNUC_END_IGNORE_DEPRECATIONS
       g_array_sort (repos_refs, repo_and_refs_compare);
 
       /* Also check the well-known special-case directories in the mount.
-       * Add them after sorting, so they’re always last. */
+       * Add them after sorting, so they’re always last.
+       * NOTE: If you change these, update the man page. */
       const gchar * const well_known_repos[] =
         {
           ".ostree/repo",
index 07a214c6503806d1f4a0432e28cf860f39a2c33b..57feeaa1d23386dfaa3cb8560fe542419e2ba818 100644 (file)
@@ -41,7 +41,6 @@ static GOptionEntry options[] =
     { NULL }
   };
 
-/* TODO: Add a man page. */
 gboolean
 ostree_builtin_create_usb (int            argc,
                            char         **argv,